﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Knjiga
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpCookie kolacic = Request.Cookies["AfinitetiKorisnika"];
            if (!(kolacic == null)) { 
                Response.Write( (String)kolacic["Korisnik"]+" Vas omiljeni auto je: "+(String)kolacic["OmiljeniAuto"]);
            }
        }

      

        protected void SnimiOmiljeniKolacic(object sender, EventArgs e)
        {
            HttpCookie kolacic = new HttpCookie("AfinitetiKorisnika");
            kolacic["OmiljeniAuto"] = txtBoxAuto.Text;
            kolacic["Korisnik"] = (String)Session["Korisnik"];
            Response.Cookies.Add(kolacic);
        }
    }
}